package com.example.batch.process;

import com.example.batch.dto.IdDto;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.stereotype.Component;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/7/17 20:49
 */
@Component
public class IdEnhanceProcess implements ItemProcessor<IdDto, IdDto> {

    /**
     * ID增强
     * @param item
     * @return
     * @throws Exception
     */
    @Override
    public IdDto process(IdDto item) throws Exception {
        item.setId("A_"+item.getId());
        return item;
    }
}
